package com.dcy.znoa.common.enums;

/**
 * Created by pengyu on 2017/10/6.
 */
public enum EstateOutnoteStatusCode {
    /**
     * 出门条状态
     1 待审批
     2 已通过
     3 已完成
     4 被拒绝
     5 已撤销
     */
    NEW(1, "待审批"),
    PASSED(2, "已通过"),
    DONE(3, "已完成"),
    REJECTED(4, "被拒绝"),
    REVOKED(5, "已撤销");

    private Integer code;
    private String msg;

    private EstateOutnoteStatusCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static EstateOutnoteStatusCode getMsgByCode(Integer code) {
        if(code==null){return null;}
        switch (code.intValue()) {
            case 1:
                return NEW;
            case 2:
                return PASSED;
            case 3:
                return DONE;
            case 4:
                return REJECTED;
            case 5:
                return REVOKED;
            default:
                return null;
        }
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static  void main(String args[]){
        System.out.println(getMsgByCode(2));

    }

}

